#include "../source/util.hpp"

int main()
{
    Json::Value root;
    root["姓名"] = "小明";
    root["年龄"] = 18;
    root["成绩"].append(98);
    root["成绩"].append(92);
    root["成绩"].append(95);
    std::string str;
    liang::JsonHelper::serialize(root, str);
    std::cout << str << std::endl;

    Json::Value root1;
    liang::JsonHelper::unserialize(str, root1);
    std::cout << "姓名: " << root1["姓名"].asString() << std::endl;
    std::cout << "年龄: " << root1["年龄"].asInt() << std::endl;
    int n = root["成绩"].size();
    for (int i = 0; i < n; i++)
    {
        std::cout << "成绩: " << root1["成绩"][i].asFloat() << std::endl;
    }    
    return 0;
}